package com.mconnect.msurvey.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

@Entity
@Table(name = "developing_languages")
public class DevelopingLanguages implements Serializable{
	private int id_language;
	private String java = "NIE";
	private String php = "NIE";
	private String javaScript = "NIE";
	private String bd_sql = "NIE";
	private String ce_plus = "NIE";
	private String python = "NIE";
	private String other = "none";
	private String ce_sharp = "NIE";
	private TechnicalQuestions id_technical;
	
	
	@Id
	@GeneratedValue
	public int getId_language() {
		return id_language;
	}
	public void setId_language(int id_language) {
		this.id_language = id_language;
	}
	
	@OneToOne(targetEntity=TechnicalQuestions.class, cascade = CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinColumn(name = "id_technical", referencedColumnName="id_technical" )
	@Fetch(FetchMode.SELECT)
	public TechnicalQuestions getId_technical() {
		return id_technical;
	}
	public void setId_technical(TechnicalQuestions id_technical) {
		this.id_technical = id_technical;
	}
	@Column(length=3)
	public String getJava() {
		return java;
	}
	public void setJava(String java) {
		if(!java.isEmpty())
			this.java = java;
	}
	@Column(length=3)
	public String getPhp() {
		return php;
	}
	public void setPhp(String php) {
		if(!php.isEmpty())
			this.php = php;
	}
	@Column(length=3)
	public String getJavaScript() {
		return javaScript;
	}
	public void setJavaScript(String javaScript) {
		if(!javaScript.isEmpty())
			this.javaScript = javaScript;
	}
	@Column(length=3)
	public String getBd_sql() {
		return bd_sql;
	}
	public void setBd_sql(String bd_sql) {
		this.bd_sql = bd_sql;
	}
	@Column(length=3)
	public String getCe_plus() {
		return ce_plus;
	}
	public void setCe_plus(String ce_plus) {
		if(!ce_plus.isEmpty())
			this.ce_plus = ce_plus;
	}
	@Column(length=3)
	public String getPython() {
		return python;
	}
	public void setPython(String python) {
		if(!python.isEmpty())
			this.python = python;
	}
	@Column(length=200)
	public String getOther() {
		return other;
	}
	public void setOther(String other) {
		if(!other.isEmpty())
			this.other = other;
	}
	@Column(length=3)
	public String getCe_sharp() {
		return ce_sharp;
	}
	public void setCe_sharp(String ce_sharp) {
		if(!ce_sharp.isEmpty())
			this.ce_sharp = ce_sharp;
	}
	public DevelopingLanguages(String java, String php, String javaScript,
			String bd_sql, String ce_plus, String python, String other,
			String ce_sharp) {
		super();
		this.java = java;
		this.php = php;
		this.javaScript = javaScript;
		this.bd_sql = bd_sql;
		this.ce_plus = ce_plus;
		this.python = python;
		this.other = other;
		this.ce_sharp = ce_sharp;
	}
	
	public DevelopingLanguages(){}

}
